package com.cloud.socketTest;

import java.io.InputStream;
import java.net.Socket;

public class ServerSocket {
    public static void main(String[] args) throws Exception{
        java.net.ServerSocket serverSocket = new java.net.ServerSocket(8081);
        Socket socket = serverSocket.accept();

        System.in.read();

        InputStream inputStream = socket.getInputStream();

        while (true) {
            byte[] bytes = new byte[1024*10];
            int n = inputStream.read(bytes);
            System.out.println(new String(bytes, 0, n));
        }
    }
}
